home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 121
/
FreelogMagazineJuilletAout2014-No121.iso
/
Outils
/
Adobe-Air
/
adobe-air_13.exe
/
[0]
/
setup.swf
/
scripts
/
InstalledAppItemRenderer.as
< prev
next >
Wrap
Text File
|
2014-03-27
|
7KB
|
231 lines
package
{
import flash.utils.getDefinitionByName;
import mx.binding.Binding;
import mx.binding.IBindingClient;
import mx.binding.IWatcherSetupUtil;
import mx.containers.Canvas;
import mx.controls.Image;
import mx.controls.Label;
import mx.core.UIComponentDescriptor;
import mx.core.mx_internal;
import mx.events.PropertyChangeEvent;
import mx.skins.ProgrammaticSkin;
use namespace mx_internal;
public class InstalledAppItemRenderer extends Canvas implements IBindingClient
{
private static var _watcherSetupUtil:IWatcherSetupUtil;
private var _437289382defaultIcon:Class;
mx_internal var _bindingsByDestination:Object;
mx_internal var _bindingsBeginWithWord:Object;
private var _1149714771appLabel:Label;
mx_internal var _watchers:Array;
private var _1410965406iconImage:Image;
mx_internal var _bindings:Array;
private var _documentDescriptor_:UIComponentDescriptor;
public function InstalledAppItemRenderer()
{
this._documentDescriptor_ = new UIComponentDescriptor({
"type":Canvas,
"propertiesFactory":function():Object
{
return {
"height":20,
"childDescriptors":[new UIComponentDescriptor({
"type":Image,
"id":"iconImage",
"stylesFactory":function():void
{
this.verticalCenter = "0";
},
"propertiesFactory":function():Object
{
return {
"height":16,
"width":16
};
}
}),new UIComponentDescriptor({
"type":Label,
"id":"appLabel",
"stylesFactory":function():void
{
this.verticalCenter = "1";
},
"propertiesFactory":function():Object
{
return {
"x":20,
"percentWidth":100
};
}
})]
};
}
});
this._437289382defaultIcon = InstalledAppItemRenderer_defaultIcon;
this._bindings = [];
this._watchers = [];
this._bindingsByDestination = {};
this._bindingsBeginWithWord = {};
super();
mx_internal::_document = this;
this.percentWidth = 100;
this.height = 20;
}
public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
{
InstalledAppItemRenderer._watcherSetupUtil = param1;
}
public function set iconImage(param1:Image) : void
{
var _loc2_:Object = this._1410965406iconImage;
if(_loc2_ !== param1)
{
this._1410965406iconImage = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"iconImage",_loc2_,param1));
}
}
override public function initialize() : void
{
var target:InstalledAppItemRenderer = null;
var watcherSetupUtilClass:Object = null;
mx_internal::setDocumentDescriptor(this._documentDescriptor_);
var bindings:Array = this._InstalledAppItemRenderer_bindingsSetup();
var watchers:Array = [];
target = this;
if(_watcherSetupUtil == null)
{
watcherSetupUtilClass = getDefinitionByName("_InstalledAppItemRendererWatcherSetupUtil");
watcherSetupUtilClass["init"](null);
}
_watcherSetupUtil.setup(this,function(param1:String):*
{
return target[param1];
},bindings,watchers);
var i:uint = 0;
while(i < bindings.length)
{
Binding(bindings[i]).execute();
i++;
}
mx_internal::_bindings = mx_internal::_bindings.concat(bindings);
mx_internal::_watchers = mx_internal::_watchers.concat(watchers);
super.initialize();
}
[Bindable(event="propertyChange")]
public function get appLabel() : Label
{
return this._1149714771appLabel;
}
override public function set data(param1:Object) : void
{
var _loc2_:String = null;
var _loc4_:String = null;
super.data = param1;
if(!param1)
{
return;
}
this.appLabel.text = param1.name;
var _loc3_:Array = [param1.icons["image16x16"],param1.icons["image32x32"],param1.icons["image48x48"],param1.icons["image128x128"]];
for each(_loc4_ in _loc3_)
{
if(_loc4_)
{
_loc2_ = _loc4_;
break;
}
}
if(!_loc2_)
{
this.iconImage.source = this.defaultIcon;
}
else
{
this.iconImage.source = "file://" + _loc2_;
}
}
private function _InstalledAppItemRenderer_bindingExprs() : void
{
var _loc1_:* = undefined;
_loc1_ = this.defaultIcon;
_loc1_ = ProgrammaticSkin;
}
[Bindable(event="propertyChange")]
private function get defaultIcon() : Class
{
return this._437289382defaultIcon;
}
[Bindable(event="propertyChange")]
public function get iconImage() : Image
{
return this._1410965406iconImage;
}
public function set appLabel(param1:Label) : void
{
var _loc2_:Object = this._1149714771appLabel;
if(_loc2_ !== param1)
{
this._1149714771appLabel = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"appLabel",_loc2_,param1));
}
}
private function _InstalledAppItemRenderer_bindingsSetup() : Array
{
var binding:Binding = null;
var result:Array = [];
binding = new Binding(this,function():Class
{
return defaultIcon;
},function(param1:Class):void
{
iconImage.setStyle("brokenImageSkin",param1);
},"iconImage.brokenImageSkin");
result[0] = binding;
binding = new Binding(this,function():Class
{
return ProgrammaticSkin;
},function(param1:Class):void
{
iconImage.setStyle("brokenImageBorderSkin",param1);
},"iconImage.brokenImageBorderSkin");
result[1] = binding;
return result;
}
private function set defaultIcon(param1:Class) : void
{
var _loc2_:Object = this._437289382defaultIcon;
if(_loc2_ !== param1)
{
this._437289382defaultIcon = param1;
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"defaultIcon",_loc2_,param1));
}
}
}
}